import http from '@/services/http';

export function login(params: MerchantManagerShopApi.LoginParams) {
  return http.post<Requestor.Response<MerchantManagerShopApi.LoginResponse>>(
    '/api/merchantbackstage/MerchantManager/open/login/pwd',
    {
      data: params,
    },
  );
}
export function logout() {
  return http.post<Requestor.TeamplateResponse>('/api/merchantbackstage/MerchantManager/outlogin');
}
export function getAllList<T>() {
  return http.post<Requestor.Response<T>>(
    '/api/merchantbackstage/MerchantManager/get/merchant/shop',
  );
}
export function getFilterList() {
  return http.get<Requestor.Response<Requestor.FilterResponse[]>>(
    '/api/merchantbackstage/MerchantManager/filter/list',
  );
}
export function getList<T>(params: MerchantManagerShopApi.ListParams) {
  return http.post<Requestor.ListResponse<T>>(
    '/api/merchantbackstage/MerchantManager/get/coupon/list',
    {
      data: params,
    },
  );
}
export function getUserInfo<T>(params: MerchantManagerShopApi.UserInfoParams) {
  return http.get<Requestor.Response<T>>('/api/merchantbackstage/MerchantManager/info', {
    params,
  });
}
export function updateStatus(params: MerchantManagerShopApi.StatusParams) {
  return http.post<Requestor.TeamplateResponse>(
    '/api/merchantbackstage/MerchantManager/update/coupon',
    {
      data: params,
    },
  );
}
